<?php

namespace App\Http\Requests\Back;

use Illuminate\Foundation\Http\FormRequest;

class CategoryRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'name' =>'required',
            'module_id' => 'required',
            'seo_title' => 'required',
            'keys' => 'required',
            'type' => 'required',
            'intro' => 'required'
        ];
    }

    public function messages()
    {
        return [
            'name.required' => '请填写分类名称',
            'module_id.required' => '请选择模块',
            'seo_title.required' => '请填写SEO标题',
            'keys.required' => '请填写关键词',
            'type.required' => '请选择分类类型',
            'intro.required' => '请填写分类描述'
        ]; // TODO: Change the autogenerated stub
    }
}
